<template>
	<view>
		<view style="background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/e63bcf73858e37c567847ca55821ddfa.png) no-repeat;background-size: 100%;width: 100%;height: 414rpx;">

		</view>
		<view style="width: 92%;position: absolute;top:10rpx;left: 4%;padding-bottom: 30rpx;">
			<view v-if="list3.length>0">
				<u-swiper
				            :list="list3"
							height="140"
							radius="10"
				            indicator
				            indicatorMode="line"
				            circular
				    ></u-swiper>
			</view>

			<view style="width: 690rpx;height: 390rpx;background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%207%402x.png) no-repeat;background-size: 100%;margin-bottom: 26rpx;box-sizing: border-box;padding: 30rpx 40rpx;position: relative;margin: 26rpx 0;">
				<view style="overflow: hidden;border-bottom: 1px solid #eeeeee;padding-bottom: 30rpx;">
					<view style="color: #242935;font-size: 32rpx;font-weight: 600;line-height: 50rpx;">
						{{xiang.name || ''}}-{{xiang.en_name || ''}}
					</view>
					<view style="color: #646566;font-size: 22rpx;line-height: 30rpx;margin: 10rpx 0;">
						厂号：{{xiang.specification_array && xiang.specification_array.length && xiang.specification_array.join(',') || ''}}
					</view>
					<view style="color: #646566;font-size: 22rpx;line-height: 30rpx;margin: 10rpx 0;">
						主营：{{xiang.manage_category_array || ''}}
					</view>
					<view class="flex items-center justify-between" style="color: #646566;font-size: 22rpx;line-height: 40rpx;height: 40rpx;">
						<view class="flex items-center" >
							<text style="float: left;">国家：{{xiang.place_info.name || ''}}</text><image :src="xiang.place_info.logo_image" style="width: 40rpx;height: 28rpx;float: left;margin-top: 6rpx;margin-left: 10rpx;" mode=""></image>
						</view>
					</view>
				</view>
				<view style="display: flex;text-align: center;margin-top: 40rpx;">
					<view @click="jinri" style="flex: 1;">
						<view>
							<text style="color: #000000;font-size: 36rpx;">{{xiang.month_num}}</text>
							<text style="color: #999999;font-size: 24rpx;">次</text>
						</view>
						<view>
							<text style="color: #999999;font-size: 24rpx;">本月更新</text>
						</view>
					</view>
					<view style="flex: 1;">
						<view>
							<text style="color: #000000;font-size: 36rpx;">{{xiang.views_num}}</text>
							<text style="color: #999999;font-size: 24rpx;">次</text>
						</view>
						<view>
							<text style="color: #999999;font-size: 24rpx;">浏览量</text>
						</view>
					</view>
					<view style="flex: 1;">
						<view>
							<text style="color: #000000;font-size: 36rpx;">{{xiang.attention_num}}</text>
							<text style="color: #999999;font-size: 24rpx;">人</text>
						</view>
						<view>
							<text style="color: #999999;font-size: 24rpx;">关注人数</text>
						</view>
					</view>
				</view>
			</view>
			<view style="display: flex;line-height: 80rpx;text-align: center;" class="justify-between">
				<view style="position: relative;" @click="qi_huo(1)" :class="qh_type==1?'qiactive_type':'qi_type'">
					价格更新
				</view>
				<view style="position: relative;" @click="qi_huo(2)" :class="qh_type==2?'qiactive_type':'qi_type'">
					厂家介绍
				</view>
				<view style="position: relative;" @click="qi_huo(3)" :class="qh_type==3?'qiactive_type':'qi_type'">
					留言互动
				</view>
			</view>
			<view v-if="qh_type==1" style="padding-bottom: 150rpx;" class="mt30">
				<view v-if="list.length>0" style="width: 100%;box-sizing: border-box;padding: 30rpx;background-color: #FFFFFF;border-radius: 16rpx;margin-bottom: 20rpx;" v-for="(item,index) in list" :key='index'>
					<view style="overflow: hidden;">
						<view style="width: 18%;float: left;overflow: hidden;">
							<image :src="item.brand_avatar" style="width: 92rpx;height: 92rpx;border-radius: 50%;display: block;" mode=""></image>
						</view>
						<view style="width: 82%;float: left;padding: 6rpx 0;">
							<view style="height: 40rpx;line-height: 40rpx;">
								<text style="color: #000000;font-size: 30rpx;display: inline-block;font-weight: 600;float: left;">{{item.brand_name}}</text>
								<image :src="item.place.logo_image" style="width: 32rpx;height: 20rpx;float: left;margin-top: 10rpx;margin-left: 20rpx;" mode=""></image>
								<text style="color: #999999;font-size: 20rpx;float: left;margin-left: 20rpx;">({{item.place.name}})</text>
								<text style="color: #999999;font-size: 24rpx;float: right;">{{item.create_time_tips}}</text>
							</view>
							<view style="height: 40rpx;line-height: 40rpx;color: #010101;font-size: 24rpx;" class="yihang">
								{{item.brand_en_name}} <text style="float: right;color: #999999;font-size: 24rpx;">发布于 {{item.create_time}}</text>
							</view>
						</view>
					</view>
					<view v-if="is_vip!=1">
						<view v-html="item.en_content" style="color: #010101;font-size: 26rpx;margin-top: 20rpx;line-height: 40rpx;">

						</view>
						<view style="background-color: #eeeeee;box-sizing: border-box;padding: 20rpx;border-radius: 10rpx;font-size: 26rpx;">
							<view v-html="item.cn_content">

							</view>
						</view>
					</view>
					<view v-if="is_vip==1">
						<view v-html="item.vip_en_content" style="color: #010101;font-size: 26rpx;margin-top: 20rpx;line-height: 40rpx;">

						</view>
						<view style="background-color: #eeeeee;box-sizing: border-box;padding: 20rpx;border-radius: 10rpx;font-size: 26rpx;">
							<view v-html="item.vip_cn_content">

							</view>
						</view>
					</view>
				</view>
				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<view v-if="list.length==0" style="text-align: center;color: #999999;font-size: 30rpx;line-height: 60rpx;">
						暂无数据
					</view>
					<view v-if="list.length>0 && enmpy" style="text-align: center;color: #999999;font-size: 30rpx;line-height: 60rpx;width: 100%;font-size: 26rpx;">
						没有更多了
					</view>
				</view>
			</view>
			<view v-if="qh_type==2" style="padding-bottom: 150rpx;">
				<view v-if="xiang.main_content" style="width: 100%;box-sizing: border-box;padding: 30rpx 20rpx;border-radius: 16rpx;background-color: #FFFFFF;margin-top: 30rpx;">
					<view v-html="content" style="color: #010101;font-size: 24rpx;line-height: 50rpx;width: 100%;">

					</view>
				</view>
				<view v-if="xiang.main_content==''" style="text-align: center;">
					<image :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<view style="text-align: center;color: #999999;font-size: 30rpx;line-height: 60rpx;">
						暂无厂家介绍
					</view>
				</view>

			</view>
			<view v-if="qh_type==3" style="padding-bottom: 150rpx;">
				<view v-if="list.length>0" style="width: 100%;margin-top: 30rpx;background-color: #FFFFFF;box-sizing: border-box;padding: 30rpx;border-radius: 16rpx;">
					<view  v-for="(item,index) in list" :key='index' style="padding-bottom: 20rpx;border-bottom: 1px solid #eeeeee;">
						<view style="width: 92%;overflow: hidden;margin: 20rpx auto;">
							<image :src="item.client.avatar" style="width: 64rpx;height: 64rpx;display: block;float: left;border-radius: 50%;margin-top: 8rpx;" mode=""></image>
							<view style="margin-left: 20rpx;float: left;">
								<view style="line-height: 40rpx;color: #191919;font-size: 26rpx;">
									{{item.client.nickname}}
								</view>
								<view style="line-height: 40rpx;color: #999999;font-size: 24rpx;">
									{{item.create_time}}
								</view>
							</view>
						</view>
						<view style="width: 92%;margin: 0 auto;color: #191919;font-size: 24rpx;line-height: 50rpx;">
							{{item.main_content}}
						</view>
						<!-- <view style="width: 92%;margin: 0 auto;color: #999999;font-size: 24rpx;line-height: 40rpx;">
							浏览{{item.pv}}次
						</view> -->
						<view v-if='item.reply' style="width: 92%;margin: 10rpx auto 30rpx;box-sizing: border-box;padding: 30rpx;border-radius: 10rpx;background-color:#F7F7F7 ;font-size: 26rpx;line-height: 50rpx;word-break:break-all;word-wrap:break-word;">
							<text style="color: #336699;">{{xiang.name}}：</text>
							<text style="color: #333333;">{{item.reply}}</text>
						</view>
					</view>
				</view>
				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<view v-if="list.length==0" style="text-align: center;color: #999999;font-size: 30rpx;line-height: 60rpx;">
						暂无数据
					</view>
					<view v-if="list.length>0 && enmpy" style="text-align: center;color: #999999;font-size: 30rpx;line-height: 60rpx;width: 100%;font-size: 26rpx;">
						没有更多了
					</view>
				</view>
			</view>
			<view style="position: fixed;left: 0;bottom: 0;width: 100%;background-color: #FFFFFF;">
				<view style="width: 100%;box-sizing: border-box;padding: 30rpx 30rpx 50rpx;display: flex;">
					<view style="width: 200rpx">
						<view @click="yijian_kefu" style="width:100%;height: 60rpx;line-height: 60rpx;border-radius: 30rpx;text-align: center;background-color: #1fb0ac;color: #FFFFFF;font-size: 24rpx;text-align: center;">
							一键代采
						</view>
					</view>
					<view style="margin-left: 20rpx;width: 200rpx">
						<view @click="dcjs" style="width:100%;height: 60rpx;line-height: 60rpx;border-radius: 30rpx;text-align: center;background-color: #fff;color: #1fb0ac;border: 1px solid #1fb0ac;font-size: 24rpx;text-align: center;">
							代采介绍
						</view>
					</view>
					<view class="flex flex-1 items-center justify-center" @click="gz_cj" style="color: #000000;font-size: 26rpx;line-height: 60rpx;font-weight: 600;">
						<image v-if="xiang.is_attention==2" src="@/static/index/icon_collect.png" style="width: 40rpx;height: 40rpx;margin: 0 10rpx 0 0" mode=""></image>
						<image v-if="xiang.is_attention==1" src="@/static/index/icon_collect1.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
						<text v-if="xiang.is_attention==1" style="color: #F0AD4E;">已关注厂家</text>
						<text v-if="xiang.is_attention==2">关注厂家</text>
					</view>
				</view>
			</view>
		</view>
		<image v-if="qh_type==3" @click="liu" src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/liu.png" style="width: 80rpx;height: 80rpx;position: fixed;right: 0;bottom: 400rpx;" mode=""></image>
		<uni-popup id="popup" ref="popup5" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 600rpx;">
				<textarea   v-model="nei" placeholder="请输入您的留言" style="padding:20rpx;font-size: 24rpx;line-height: 40rpx;height: 200rpx;" />
				<view class="footer">
					<button @click="quxiao5" style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
					 type="default">取消</button>
					<button @click="huifu" lang="zh_CN" style="flex: 1;background-color: #1fb0ac;color: #FFFFFF;" open-type="getUserInfo">留言</button>
					<!-- <button @click="submitLink" type="default" class="submit">确认提交</button> -->
				</view>
			</view>
		</uni-popup>

		<uni-popup id="popup" ref="popup2" :type="type_status" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的手机号</view>
				<view class="footer">
					<button @click="quxiao2"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @getphonenumber="login2" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getPhoneNumber">确定</button>
				</view>
			</view>
		</uni-popup>
    <uni-popup
      class="login-popup"
      mode="center"
      id="popupReport"
      mask-background-color="rgba(0,0,0,0.9)"
      ref="popupReport"
      :type="type_status"
      :animation="true"
    >
      <view class="login_container relative" style="background-color: #FFFFFF;padding:50rpx 44rpx 30rpx;border-radius: 20rpx;">
        <view
          class=""
          style="background-color: #FFFFFF;border-radius: 20rpx;">
          <view style="line-height: 80upx;color: #333333;font-size: 30upx;height: 80rpx;">
            内容描述
          </view>
          <view class="textarea_item">
            <textarea  maxlength="540" placeholder="请输入内容描述(最多540字符)" v-model="reportContent"
            style="width: auto;height: 300rpx;line-height: 40rpx;font-size: 26rpx;" />
          </view>
          <view class="upload">
            <view class="uploadimgcont">
              <view class="uploadimga" v-for="(item,index) in addImgArray_arr" :key="index">
                <view class="delete" @click="imgdelete(index)">
                  <view class="deleteline">
                  </view>
                </view>
                <image @click="fangda(index)" :src="item" mode="aspectFill"></image>
              </view>
              <view  v-if="!addImgArray_arr || addImgArray_arr.length<9" class="uploadimg" @click="chooseImage">
                <image
                  src="@/static/msg/add-photo.png"
                  style="border-radius: 12rpx;" mode=""></image>
              </view>
            </view>
          </view>
        </view>
        <view class="footer1 flex" style="display: flex;align-items: center;justify-content: center;margin-top: 60rpx;">
          <u-button
            style="width: 240rpx;height: 80rpx;
                line-height: 80rpx;
                color: #666;
                border-radius: 80rpx;
                border: 1px solid #d9d9d9;
                background-color: #d9d9d9;
                margin-right: 30rpx;"
            text="取消"
            @click="cancelPopupReport"
            shape="circle"
          ></u-button>
          <u-button
            @click="submitReport"
            style="width: 240rpx;
              height: 80rpx;
              line-height: 80rpx;"
            text="确定"
            shape="circle"
            color="linear-gradient(to right, #1CD19F, #1FB0AC)"
          ></u-button>
        </view>
      </view>
    </uni-popup>
    <uploadImg :singleNum="false" ref="uploadImg" v-model="addImgArray_arr" permissionCameraContent="获取拍照权限是为了能够上传图片" permissionAlbumContent="获取相册权限，是为了能够上传图片" />
    <noLoginToast ref="noLoginToast" />
	</view>
</template>
<script>
	import {
		validateNull
	} from '@/common'
	import {
		genTestUserSig
	} from '@/im/debug/GenerateTestUserSig.js';
	import report from '@/components/report/report';
	import report1 from './components/report';
	const app = getApp();
	import TIM from 'tim-wx-sdk/tim-wx-friendship.js';
	import COS from 'cos-wx-sdk-v5';
	export default{
		components: {
			report,
			report1
		},
		data(){
			return{
				type_status: 'center',
				isChecked: false,
				isLogin: 'login',
				reportId: '',
				reportContent: '',
				addImgArray_arr: [],
				reportParams: {},
				list3: [],
				qh_type:1,
				id:'',
				xiang:{},
				page:1,
				list:[],
				kk:false,
				enmpy:false,
				is_vip:2,
				type:'center',
				nei:'',
				content:'',
				en_content:'',
				cn_content:'',
				vip_en_content:'',
				vip_cn_content:'',
				type_status:'center',
				getUserInfo: ''
			}
		},
		onReady() {
		},
		onLoad(option) {
			this.id=option.id
			this.cjxq()
			this.gengxin()
			this.userinfo()
		},
		onShow() {
			this.denglu_im()
		},
		onShareAppMessage: function(e) {
			let that=this
			return {
				title: that.xiang.name+'-'+that.xiang.en_name,
				path: '/fenbao/pages/wenzhang/cjxq?id='+that.id,
			}
		},
		onShareTimeline: function(e) {
			let that=this
			return {
				title: that.xiang.name+'-'+that.xiang.en_name,
				path: '/fenbao/pages/wenzhang/cjxq?id='+that.id,
			}
		},
		onReachBottom: function() {
			if(this.qh_type==1){
				if (this.enmpy) {
					return
				} else {
					this.gengxin()
				}
			}else if(this.qh_type==3){
				if (this.enmpy) {
					return
				} else {
					this.liuyan()
				}
			}

		},
		methods:{
			async openReport() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				this.$refs.popupReport.open()
			},
			submitReport() {
				if (validateNull(this.reportContent)) {
					return uni.showToast({
						title: '内容不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				if (validateNull(this.addImgArray_arr)) {
					return uni.showToast({
						title: '图片不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				// /api/client/complaint     POST
				// uid=投诉对象id，必传
				// msg=消息，必传
				// img=图片，非必传
				let params = {
					msg: this.reportContent,
					img: this.addImgArray_arr.join(','),
					uid: this.id
				}
				console.log('%c [ params ]-144', 'font-size:13px; background:pink; color:#bf2c9f;', params)
				// return
				this.post('api/client/complaint',params,true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: '举报成功',
							icon: "none",
							duration: 1000
						})
						this.closePopupReport()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			cancelPopupReport() {
				this.closePopupReport()
			},
			closePopupReport() {
				this.$refs.popupReport.close()
			},
			// 上传图片
			async chooseImage() {
				// let isLogin = await this.$refs.noLoginToast.open()
				// if (!isLogin) {
				// 	return
				// }
				// let stutas = await requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
				// openAppSettingPermissions()
				// console.log('%c [ stutas ]-862', 'font-size:13px; background:pink; color:#bf2c9f;', stutas)
				let that = this
				if (that.addImgArray_arr.length >= 9) {
					uni.showToast({
						icon: 'none',
						title: '最多上传9张图片'
					})
					return
				}
				try {
					this.$refs.uploadImg.open()
				} catch (error) {
					uni.hideLoading()
				}
			},
			// 删除图片
			imgdelete(index) {
				// this.addimgArray.splice(index, 1)
				this.addImgArray_arr.splice(index, 1)
				// this.addimgArray.splice(index, 1)
			},
			async yijian_kefu(){
				let that=this
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.post('api/im/im/purchasing',{brand_id:this.id},true).then(res=>{
					if(res.code==1){
						let aid='GROUP'+res.data.group_id
						if(uni.getStorageSync('userinfo').is_server==1){
							uni.setStorageSync('user_id',res.data.user.id)
						}else{
							uni.setStorageSync('user_id',0)
						}

						uni.setStorageSync('friend_name',res.data.server.name)
						uni.navigateTo({
								url: `/im/chat/dan_chat?conversationID=${aid}`,
									// url: `/im/login/login`,
						})
					}else{
									uni.showToast({
										title: res.msg,
										icon: "none",
										duration: 1000
									})
								}
				})
			},
			denglu_im() {
				let that=this
				const userID = uni.getStorageSync('mobile2').toString();
				const userSig = genTestUserSig(userID).userSig;
				app.globalData.userInfo = {
					userSig,
					userID
				};

				uni.setStorageSync('userInfo', app.globalData.userInfo);

				// 登录腾讯im
				uni.$TUIKit
					.login({
						userID: userID,
						userSig: userSig
					})
					.then(res => {
						this.$store.commit('setToken', app.globalData.userInfo);

						uni.$TUIKit.on(uni.$TUIKitEvent.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated);
						setTimeout(function(){
							that.getConversationList();
						},500)
					})
					.catch(() => {});
				console.log('llllliiuiuuuu')

			},
			// 代采介绍
			async dcjs(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				uni.navigateTo({
					url:'../../../subpages/pages/dcjs?id='+this.id
				})
			},
			userinfo(){
				this.post('api/client/info','',true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.is_vip=res.data.is_vip
					}
				})
			},
			qi_huo(index){
				this.qh_type=index
				if(index==1){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.gengxin()
				}else if(index==3){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.liuyan()
				}
			},
			// 今日价格
			async jinri(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				uni.navigateTo({
					url:'jrjg'
				})

			},
			cjxq(){
				this.post('api/futures/brand_info',{id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.xiang=res.data
						this.list3=res.data.main_images
						this.content=res.data.main_content.replace(/<img/gi,   '<img style="width:100%!important" class="rich-img" ')
						                                                  .replace(/<p/g, '<div class="rich-div"')
						                                                  .replace(/\/p>/g, '\div>')
																		  .replace(/<div/g, '<div class="rich-div"')
																		  .replace(/\/div>/g, '\div>')
																		  .replace(/<span/g, '<div class="rich-span"')
																		  .replace(/\/span>/g, '\div>');
					}
				})
			},
			// 价格更新
			gengxin(){
				this.post('api/futures/brand_futures',{id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 留言互动
			async liuyan(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.post('api/futures/brand_message',{id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			async liu(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.$refs.popup5.open()

			},
			quxiao5(){
				this.$refs.popup5.close()
			},
			async huifu(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.post('api/futures/message_add',{brand_id:this.id,main_content:this.nei},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						this.$refs.popup5.close()
						this.nei=''
						this.page= 1
						this.kk=false
						this.enmpy= false
						this.list=[]
						this.liuyan()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 关注厂家
			async gz_cj(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.post('api/futures/attention',{id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						if(res.data){
							this.xiang.is_attention=1
						}else{
							this.xiang.is_attention=2
						}
					}
				})
			},
			quxiao2: function() {
				this.$refs.popup2.close()
			},
			login2: function(e) {
				console.log(e)
				let that = this
				this.$refs.popup2.close()
				uni.login({
					provider: 'weixin',
					success: (code) => {
						console.log(code)
						this.post('api/wechat/phone', {
							code: code.code,
							iv: e.detail.iv,
							encryptedData: e.detail.encryptedData
						}, true).then(res => {
							console.log(res, '123455')
							if (res.code == 1) {
								uni.setStorageSync('mobile', res.data.phoneNumber)
								uni.setStorageSync('mobile2',res.data.mobile2)
								that.denglu_im()
								that.cjxq()
								that.gengxin()
								that.userinfo()
							}

						})

					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
	.rich-img {
		max-width: 100% !important;
		height: auto!important;
		display: block;
		// background-color: #FFFFFF;
	}
	.rich-div{
		width: 100%!important;
		margin: 0 auto;
		::deep img {
			width: 100%!important;
		}
	}
	.rich-span{
		display: inline-block!important;
		width: 100%!important;
	}
	page{
		background-color: #F8F8F8!important;
		padding-bottom: 150rpx;
		font-family: Demibold;
	}
	.qi_type{
		color: #999999;
		font-size: 30rpx;
		font-weight: 500;
	}
	.qiactive_type{
		color: #000000;
		font-size: 30rpx;
		font-weight: 600;
	}
	.qiactive_type::after {
	     content: ''; // 必须
	     position: absolute;
	     left: 50%;
	     bottom: 0rpx;
		 transform: translateX(-50%);
	     width: 110rpx;
	     height: 6rpx;
	     background-color: #19BE6B;
	}
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
	.rich-img {
		width: 100% !important;
	}
</style>
<style lang="scss">
.footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #f4f4f4;
  margin-top: 30rpx;
  padding-bottom: 20rpx;

  button {
    margin: 0 auto;
    width: 100%;
    background-color: #19be6b;
    // width: 200upx;
    border-radius: 10upx;
    font-size: $uni-font-size-sm;
    // padding: 22upx 34upx;
    height: 80upx;
    font-size: 30rpx;
    line-height: 80upx !important;
    // line-height: 1;
    color: #ffffff;
  }

  button:after {
    border: 0;
  }
}
.login_container {
  width: 600rpx !important;
  margin: 0 auto;
  border-radius: 20rpx;
  // background: url("@/static/login/login_bg.png") no-repeat;
  // background-size: cover;
  // background-size: 100% 100%;
  padding-bottom: 60rpx !important;
  .footer1 {
    margin-top: 60rpx;
  }
}
.content-item {
  margin: 0 0 44rpx;
  text-align: center;
  line-height: 42rpx;
  color: #000;
  font-size: 36rpx;
}
.custom-style {
  width: 400rpx;
  height: 80rpx;
  line-height: 80rpx;
  color: #666;
  border-radius: 80rpx;
  border: 1px solid #d9d9d9;
  background-color: #d9d9d9;
  margin-right: 30rpx;
}
.custom-style-login {
  width: 400rpx;
  height: 80rpx;
  line-height: 80rpx;
}
.login-popup /deep/ .uni-mask--hook {
  background-color: rgba(0, 0, 0, 0.5) !important;
}
.user_agreement_container /deep/ .private {
  margin-left: 40rpx;
}
.close_icon {
  position: absolute;
  top: 26rpx;
  right: 26rpx;
  z-index: 1;
}
.custom-style {
  width: 400rpx;
  height: 80rpx;
  line-height: 80rpx;
  color: #666;
  border-radius: 80rpx;
  border: 1px solid #d9d9d9;
  background-color: #d9d9d9;
  margin-right: 30rpx;
}

// 上传图片
.upload {
		// background: #FFFFFF;
		// padding: 0 40rpx;
		// height: 100vh;
		// height: 700upx;

		.title {
			font-size: 30rpx;
			font-weight: bold;
			color: #343434;
			padding-top: 15rpx;
		}

		.uploadimgcont {
			display: flex;
			// justify-content: space-between;
			flex-wrap: wrap;
			// margin-top: 50rpx;
			// margin:30upx 0 136upx;

			.uploadimga {
				width: 186rpx;
				height: 186rpx;
				margin-right: 24upx;
				margin-bottom: 40upx;
				position: relative;

				.delete {
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					background: #5093ff;
					display: flex;
					align-items: center;
					justify-content: space-around;
					position: absolute;
					top: -10upx;
					left: -10upx;
					z-index: 4;

					.deleteline {
						background: #FFFFFF;
						height: 5rpx;
						width: 50%;
					}
				}

				image {
					width: 100%;
					height: 100%;
				}
			}

			.uploadimg {
				width: 120rpx;
				height: 120rpx;
				background: #F9F9F9;
				border-radius: 120rpx;
				// overflow: hidden;
				position: relative;

				image {
					width: 100%;
					height: 100%;
				}

				view {
					position: absolute;
					bottom: 10rpx;
					left: 50%;
					width: 100%;
					text-align: center;
					transform: translateX(-50%);
					font-size: 28rpx;
					color: #404040;
				}
			}
		}

}
.textarea_item {
  padding: 20rpx;
  border: 1rpx solid #ddd;
  margin-bottom: 20rpx;
}
</style>
